package com.tencent.cloud.iov.util.crypt;

import org.spongycastle.crypto.agreement.srp.SRP6StandardGroups;
import org.spongycastle.crypto.params.SRP6GroupParameters;

/**
 * @author vinsonhuang
 * @date 2018/8/25
 */
public class SRPData {
    private String group;
    private String salt;
    private String verify;

    public static SRP6GroupParameters getGroupParameters(String group) {
        switch (group) {
            case "1024":
                return SRP6StandardGroups.rfc5054_1024;
            case "1536":
                return SRP6StandardGroups.rfc5054_1536;
            case "2048":
                return SRP6StandardGroups.rfc5054_2048;
            case "3072":
                return SRP6StandardGroups.rfc5054_3072;
            case "4096":
                return SRP6StandardGroups.rfc5054_4096;
            case "6144":
                return SRP6StandardGroups.rfc5054_6144;
            case "8291":
                return SRP6StandardGroups.rfc5054_8192;
            default:
                return null;
        }
    }

    public SRP6GroupParameters getGroupParameters() {
        return getGroupParameters(group);
    }
}
